function [IDX,D] = knnadasearch(V, X, k)
%KNNADASEARCH Find K nearest neighbors by adaptive search
%
%
%   Suqi Liu

XV = X*V'
XX = sum(X.*X,2);
VV = sum(V.*V,2);

DD = repmat(XX,1,size(V,1)) + repmat(VV',size(X,1),1) - 2*XV;

